-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Behaviors access result #3704
Behaviors access result #3704
Conversation
@@ -90,7 +90,7 @@ class TimedBehavior : public nav2_core::Behavior | |||
// Implement the behavior such that it runs some unit of work on each call | |||
// and provides a status. The Behavior will finish once SUCCEEDED is returned | |||
// It's up to the derived class to define the final commanded velocity. | |||
virtual ResultStatus onCycleUpdate() = 0; | |||
virtual ResultStatus onCycleUpdate(std::shared_ptr<typename ActionT::Result> result) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this make alot more sense in onActionCompletion
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really have a preference. I figured it would be easy to leave it in onCycleUpdate
. I can move it over though :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do. I dont think cycle updates should need to populate the result. The ‘action complete’ callback seems like the right place
@@ -77,7 +77,7 @@ void AssistedTeleop::onActionCompletion() | |||
preempt_teleop_ = false; | |||
} | |||
|
|||
ResultStatus AssistedTeleop::onCycleUpdate() | |||
ResultStatus AssistedTeleop::onCycleUpdate(std::shared_ptr<AssistedTeleopActionResult>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: but add the commented out name /*result*/
like we do elsewhere in the codebase for all eq.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3704 +/- ##
==========================================
- Coverage 90.41% 90.40% -0.01%
==========================================
Files 411 411
Lines 17801 17804 +3
==========================================
+ Hits 16095 16096 +1
- Misses 1706 1708 +2
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good to me. Docs update per usual + I tink we need to update the tutorial on behavior API to mention this (and perhaps your other recent update)
can I backport this into iron? |
No, this is an ABI breaking change |
* onCycle has access to the result * revert * pr review Signed-off-by: enricosutera <enricosutera@outlook.com>
* onCycle has access to the result * revert * pr review
Basic Info
Description of contribution in a few bullet points
Allow recoveries to have access to the result. This allows behaviors to set the result message.
Description of documentation updates required from your changes
Future work that may be required in bullet points
For Maintainers: